import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ChickenChickInVO, ChickenChickInForm, ChickenChickInQuery } from '@/api/farm/chickenChickIn/types';

/**
 * 查询鸡苗采购列表
 * @param query
 * @returns {*}
 */

export const listChickenChickIn = (query?: ChickenChickInQuery): AxiosPromise<ChickenChickInVO[]> => {
  return request({
    url: '/farm/chickenChickIn/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询鸡苗采购详细
 * @param id
 */
export const getChickenChickIn = (id: string | number): AxiosPromise<ChickenChickInVO> => {
  return request({
    url: '/farm/chickenChickIn/' + id,
    method: 'get'
  });
};

/**
 * 新增鸡苗采购
 * @param data
 */
export const addChickenChickIn = (data: ChickenChickInForm) => {
  return request({
    url: '/farm/chickenChickIn',
    method: 'post',
    data: data
  });
};

/**
 * 修改鸡苗采购
 * @param data
 */
export const updateChickenChickIn = (data: ChickenChickInForm) => {
  return request({
    url: '/farm/chickenChickIn',
    method: 'put',
    data: data
  });
};

/**
 * 删除鸡苗采购
 * @param id
 */
export const delChickenChickIn = (id: string | number | Array<string | number>) => {
  return request({
    url: '/farm/chickenChickIn/' + id,
    method: 'delete'
  });
};
